/**
 * 表格数据适配器
 * @param data 待处理的基础数据
 * @param dataKey 表格数据key
 * @param pageKey 当前页码key
 * @param rowsKey 每页行数key
 * @param totalKey 总条数key
 */
export const tableDataAdapter:any = (
  data:any = {},
  dataKey = 'records',
  pageKey = 'page',
  rowsKey = 'rows',
  totalKey = 'total'
  ) => {
  // const d = data.map((item)=>({
  //   records: item[dataKey],
  //   page: item[pageKey],
  //   rows: item[rowsKey],
  //   total: item[totalKey]
  // }));
  return {
      records: data[dataKey],
      page: data[pageKey],
      rows: data[rowsKey],
      total: data[totalKey]
    }
}